rters.tif.default = convert
\stopluacode
\setfigureconversion[tif][jpg] % has no effect
\defineexternalfigure[tif][conversion=jpg]
\starttexdefinition includegraphics #1
\splitfilename{#1}
\processaction[\splitofftype][
tif=>{\externalfigure[#1][tif]},
default=>{\externa
inlineuserdata?
%% MWE:
\setupinteraction[state=start]
\define[2]\imghref{\bgroup\goto{#1}[url(#2)]\egroup}
\defineexternalfigure[logo][height=1em]
\definedataset[autores]
\setdataset[autores][
nombre={Angie Natalia Farfán Acevedo},
cvlac={
https://scienti.minciencias.gov.co/cvlac/visualizador
=\measure{combination}]}{mill}
{\externalfigure[hacker][width=\measure{combination}]}{hacker}
\stopcombination
But that’s still tedious.
With the power of \defineexternalfigure:
\defineexternalfigure[combination][width=\measure{combination}]
(That’s predefined, no need to copy!)
\startcombination[3
On 8/1/2022 2:29 AM, Thangalin via ntg-context wrote:
Got it working. Complete solution:
|\setupexternalfigures[ location={local,global,default},
width=\textwidth ] \defineexternalfigure[svg][width=1cm]
\defineexternalfigure[jpg][width=2cm]
\defineexternalfigure[png][width=4cm] % Won't
Got it working. Complete solution:
\setupexternalfigures[
location={local,global,default},
width=\textwidth
]\defineexternalfigure[svg][width=1cm]\defineexternalfigure[jpg][width=2cm]\defineexternalfigure[png][width=4cm]
% Won't be applied because there's no process action.% Default
ich was used in my
example to pass the default values with \defineexternalfigure. Just
using \externalfigure[#1][conversion=mp] where you pass the default
values with the second argument is enough.
Wolfgang
___
If y
ain!
> \setupexternalfigures [location={local,global,default}]
>
> \defineexternalfigure [jpg] [width=4cm]
> \defineexternalfigure [png] [width=8cm]
>
> \starttexdefinition includegraphics #1
>
> \splitfilename{#1}
>
> \processaction
> [\splitofftype]
>
the
> file name extension (and header within the file).
>
> One possibility would be something like:
>
> \setupexternalfigure[
> width=1em,
> height=1em,
> order={svg,pdf,png,jpg},
> location={local,default,global},
> ]
> \defineexternalfigure[p
}, ] \defineexternalfigure[png][
width=\textwidth, height=\textheight, ] \unprotect
\let\old_externalfigure=\externalfigure
\tolerant\def\externalfigure[#1]#,[#2]#,[#3]{%
\doifelseinstring{.png}{#1}{% \old_externalfigure[#1][png][#2]% }{%
\doifelsefileexists{#1.png}{% \old_externalfigure[#1.png][png
}, ] \defineexternalfigure[png][
width=\textwidth, height=\textheight, ] \unprotect
\let\old_externalfigure=\externalfigure
\tolerant\def\externalfigure[#1]#,[#2]#,[#3]{%
\doifelseinstring{.png}{#1}{% \old_externalfigure[#1][png][#2]% }{%
\doifelsefileexists{#1.png}{% \old_externalfigure[#1.png
way. The only part that differs is the
file name extension (and header within the file).
One possibility would be something like:
\setupexternalfigure[
width=1em,
height=1em,
order={svg,pdf,png,jpg},
location={local,default,global},
]
\defineexternalfigure[png][
width=\textwidth
Am 08.07.22 um 17:46 schrieb Thangalin via ntg-context:
I'd like to change the `maxheight` option for only PNG images, such as:
Define your own figure class with \definexternalfigure:
https://wiki.contextgarden.net/Command/defineexternalfigure
It won’t automatically chose the file format
}]
\defineexternalfigure[rotated][orientation=90]
\starttext
\externalfigure[hacker.jpg][rotated]
\stoptext
Wolfgang
___
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context
]
\defineexternalfigure[dummy]
\starttext
\startplacefigure[location=left,number=no,title={}]
\externalfigure[dummy][width=.45\textwidth]
\stopplacefigure
\dontleavehmode % if this is commented out then the text and the
figure are placed on top of each other
\startframedtext[frame=off]
\input
]
\defineexternalfigure[dummy]
\starttext
\startplacefigure[location=left,number=no,title={}]
\externalfigure[dummy][width=.45\textwidth]
\stopplacefigure
\dontleavehmode % if this is commented out then the text and the
figure are placed on top of each other
\startframedtext[frame=off]
\input
the issue, but since in my document I have a certain
number of cases where such combinations are used, I woul dlike to be sure to
not make a mistake by changing all the instances… Here is an example:
%% begin figure-framedtext.tex
\useMPlibrary[dum]
\defineexternalfigure[dummy]
\starttext
und the issue, but since in my document I have a certain
> number of cases where such combinations are used, I woul dlike to be sure to
> not make a mistake by changing all the instances… Here is an example:
>
> %% begin figure-framedtext.tex
> \useMPlibrary[dum]
> \defineexternalfi
a certain
number of cases where such combinations are used, I woul dlike to be sure to
not make a mistake by changing all the instances… Here is an example:
%% begin figure-framedtext.tex
\useMPlibrary[dum]
\defineexternalfigure[dummy]
\starttext
\startplacefigure[location=left,number=no,title
control the vertical alignment with a few box commands but what
> you
> > should use depends on the context, in tables I would use 2 while in
> running
> > text 3 can be better. Which alignment you’re using is your choice.
> >
> >
> > \useMPlibrary[dum]
> >
>
be better. Which alignment you’re using is your choice.
\useMPlibrary[dum]
\defineexternalfigure[dummy][width=4cm,height=3cm]
\setuplayout[grid=yes]
\showgrid
\starttext
Default: \externalfigure[dummy]
%1: \bottomrightbox{\externalfigure[dummy]}\quad
1: \aligned[bottom,right
choice.
\useMPlibrary[dum]
\defineexternalfigure[dummy][width=4cm,height=3cm]
\setuplayout[grid=yes]
\showgrid
\starttext
Default: \externalfigure[dummy]
%1: \bottomrightbox{\externalfigure[dummy]}\quad
1: \aligned[bottom,right]{\externalfigure[dummy]}\quad
2: \tbox{\externalfigure[dummy
t work because you have no paragraphs in your document.
When you
add \dontleavehmode before each \externalfigure the entries are correct.
\setupwhitespace[line]
\defineexternalfigure[score][width=\textwidth]
\starttext
\dontleavehmode\externalfigure[Alaude][score]\index{Alaude}
\dontleav
externalfigure[delta] \par
+% 4cm breed: \externalfigure[beta] [width=4cm] \par
+% 5cm breed: \externalfigure[gamma][width=5cm] \par
%
% \defineexternalfigure[a][width=10cm]
% \defineexternalfigure[b][width=5cm]
>> \stoptext
>>
>> Using latest beta from 2016.07.08 17:19, scaling doesn’t work.
>
> next beta:
>
> \setupexternalfigure[location=default]
> \defineexternalfigure[foo][width=.5\textwidth]
>
> \starttext \showframe
>
> \insertpages[cow.pdf][c
:
\setupexternalfigure[location=default]
\defineexternalfigure[foo][width=.5\textwidth]
\starttext \showframe
\insertpages[cow.pdf][category=foo]
\stoptext
(you wikify it)
-
Hans Hagen | PRAGMA ADE
by height and vice versa. Defining
both
width and height results in exact resizing and the aspect ratio is not
maintained.
How can this be solved?
\useMPlibrary[dum]
\showframe
\starttext
\setuplayout[middle]
\defineexternalfigure[quarter][factor=max]
\vbox{\dorecurse{4}{\hbox{\hsize.25
is the code
\setupexternalfigures [directory={/Path/to/the/Photos}]
\defineexternalfigure[photo][maxheight=0.4\textheight]
\define \numberText{1}
\starttext
\dostepwiserecurse{141}{146}{1}/% //\recurselevel is part of photo
filename. See below./
{
\externalfigure[sam_0\recurselevel.jpg
suggestions would be helpfull.
Here is the code
\setupexternalfigures [directory={/Path/to/the/Photos}]
\defineexternalfigure[photo][maxheight=0.4\textheight]
\define \numberText{1}
\starttext
\dostepwiserecurse{141}{146}{1}/% //\recurselevel is part of photo
filename. See below
={/Path/to/the/Photos}]
\defineexternalfigure[photo][maxheight=0.4\textheight]
\define \numberText{1}
\starttext
\dostepwiserecurse{141}{146}{1}/% //\recurselevel is part of photo
filename. See below./
{
\externalfigure[sam_0\recurselevel.jpg][photo] \par /% //\recurselevel
is part of photo filename
in \setupfloat[figure] doesn't work. Am I
reading the manual wrong, or is is just not implemented yet or something?
(honest question)
Thanks for your response,
Mark
Hi Mark,
You can use \defineexternalfigure as in the following example.
\defineexternalfigure[whatever][width=2cm]
\starttext
\placefigure
macros or something to solve this, but I'm
just puzzled that setting width in \setupfloat[figure] doesn't work. Am I
reading the manual wrong, or is is just not implemented yet or something?
(honest question)
Thanks for your response,
Mark
Hi Mark,
You can use \defineexternalfigure
\stoptext
Actual results: the image appears as undefined.
Expected results: the image appears, stretched to fill the column.
Work around 1: use wfactor.
Work around 2: \defineexternalfigure[fullwidth][factor=fit] and then use
\externalfigure[file.jpg][fullwidth]
Kind regards
or environment:
\defineexternalfigure[sizeone][width=5cm]
\defineexternalfigure[sizetwo][height=4cm]
(these can also inherit: \definexternalfigure[a][b][frame=on])
In the document source:
\externalfigure[cow][sizeone]
\externalfigure[cow][sizetwo][frame=on]
A way to get consistent scaling
\externalfigure[cow][ratio][factor=max] \NC \NR
\NC fit \NC \externalfigure[cow][ratio][factor=fit] \NC \NR
\stopTABLE
\stopbuffer
\starttext
\subject {Width Height}
\defineexternalfigure[ratio][height=1cm,width=5cm]
\getbuffer
\subject {Height Width}
\defineexternalfigure[ratio][width=1cm,height
markdown doc and regenerate the context document the
issue persists with or without subsequent edit!! Damned peculiar. Here's
the workflow:
pandoc -s -f markdown -t context file.md -o file.context.tex
gedit file.context.tex to add:
\defineexternalfigure[screenshot][frame=on]
and then add
file.context.tex to add:
\defineexternalfigure[screenshot][frame=on]
and then add [screenshot] to all of the \externalfigure directives. Then find
the /crlf that appear immediate before *all* of the \externalfigure
directives and double them (unless someone who reads this can tell me how to
easily
on that pandoc output. I have edited the context file to include
a /defineexternalfigure directive to put a frame around all images. The
images I have are all screenshots of application usage steps. The
crucial output is html that goes into our online Knowledge base.
Secondary output is PDF
if this should be classified as a bug, but I am posting it here
in case anyone else encounters the same issue and needs to know how to
override this behavior:
\externalfigure[cow][width=1cm, height=3cm, scale=]
if needed you can use an abstraction:
\starttext
\defineexternalfigure[whatever
:
\starttext
\defineexternalfigure[whatever][width=3cm,height=4cm]
\defineexternalfigure[another] [scale=500]
\externalfigure[cow]
\externalfigure[cow][whatever]
\externalfigure[cow][another]
\stoptext
I actually use these abstractions, but with the default value also set.
That's the whole point
]
\defineexternalfigure[grid]
[width=0.55\paperwidth, height=0.33\paperwidth, scale=, factor=]
Around five months ago, I did not need to reset scale and factor.
The code now uses the new inheritance mechamisn and in mkii external
figures had a whole bunch of (sometimes tricky) resets. Some were
=\textwidth,
maxheight=\textheight]
\defineexternalfigure[grid]
[width=0.55\paperwidth, height=0.33\paperwidth, scale=, factor=]
Around five months ago, I did not need to reset scale and factor.
The code now uses the new inheritance mechamisn and in mkii external figures
had a whole bunch
Hi,
In the next beta \definexternalfigure is chained.
\starttext
\defineexternalfigure[test][width=2cm]
\defineexternalfigure[less][test][width=3cm,background=color,backgroundcolor=green]
\setupexternalfigure [less][height=.5cm]
\externalfigure[cow.pdf][test] \par
\externalfigure[cow.pdf
control about the height gives you this method:
\defineexternalfigure[inline][height=1.8ex]
\starttext
This is a cow \externalfigure[cow][inline].
\stoptext
Wolfgang
___
If your question is of interest to others
More control about the height gives you this method:
\defineexternalfigure[inline][height=1.8ex]
\starttext
This is a cow \externalfigure[cow][inline].
\stoptext
Wolfgang
This, especially the second method, is exactly what I wanted. Thank you very
much Wolfgang.
Best regards,
Robert
control about the height gives you this method:
\defineexternalfigure[inline][height=1.8ex]
\starttext
This is a cow \externalfigure[cow][inline].
\stoptext
Wolfgang
___
If your question is of interest to others
On 8-2-2010 23:18, Bernhard Rosensteiner wrote:
Am 08.02.2010 um 23:07 schrieb Hans Hagen:
On 8-2-2010 22:16, Bernhard Rosensteiner wrote:
Am 08.02.2010 um 19:42 schrieb Hans Hagen:
On 8-2-2010 18:52, Bernhard Rosensteiner wrote:
thanks for the hint with \defineexternalfigure… - indeed
- the outcome of the height is so not really predictable)
normally one will have categories of graphics, so you can do things like
(one of the oldest mechanisms)
\starttext
\defineexternalfigure[whatever][height=3cm]
\startcombination
{\externalfigure[cow.pdf] [whatever
On 8-2-2010 22:16, Bernhard Rosensteiner wrote:
Am 08.02.2010 um 19:42 schrieb Hans Hagen:
On 8-2-2010 18:52, Bernhard Rosensteiner wrote:
thanks for the hint with \defineexternalfigure… - indeed useful.
The „automatic“ feature of floatrow is nice but not so important that i will
ever
=2cm]
\defineexternalfigure[whatever][background={foreground,figure}]
\startsetups figure
\setlayerframed[figure][preset=righttop,x=.25\layerwidth,y=.25\layerheight]{\red
MORE}
\setlayerframed[figure][preset=middle,foregroundcolor=green]{EVEN MORE}
\stopsetups
]
\definedescription[name][settings]
# \definedfont
\defineenumeration[names][name][settings]
# \defineexternalfigure
\definefield[reference][widget type][setup name][names][initial content]
\definefieldstack[name][names][settings]
\definefiguresymbol[name][text][settings]
\definefloat[singular
=grid,inbetween=]
\defineexternalfigure[enkel] [width=10cm,frame=on,grid=depth]
\defineexternalfigure[dubbel][width=10cm,frame=on,grid=depth]
\starttext
test \placefigure{}
{\externalfigure[t:/sources/cow.pdf][frame=on,grid=yes]} test \page
test \placefigure{\input
zapf\relax
of moments of expansion
fix (in core-fig.tex:)
\def\dodoplaceexternalfigure[#1][#2][#3][#4][#5][#6]%
{\doifsomething{#3}% catches \defineexternalfigure dummies
{\bgroup
\pushmacro\textunderscore
\edef\textunderscore{\string_}% brrr, temp hack, still needed?
\calculateexternalfigure
52 matches
Mail list logo